package com.github.phoenics.militia.bazookaFx.model;


import com.github.phoenics.militia.bazookaFx.domain.enums.DatabaseType;
import javafx.beans.property.*;

import java.util.Date;

/**
 * @author Phoenics Chow
 * on 2019年01月31日
 */
public class AppModel implements IModel{
    private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AppModel.class);
    private LongProperty id=new SimpleLongProperty();
    private StringProperty schemaName=new SimpleStringProperty();
    private StringProperty appName=new SimpleStringProperty();
    private StringProperty appCnName=new SimpleStringProperty();
    private ObjectProperty<DatabaseType> dbType=new SimpleObjectProperty<>();
    private StringProperty dfPackageHead=new SimpleStringProperty();
    private StringProperty modelName=new SimpleStringProperty();
    private StringProperty author=new SimpleStringProperty();
    private StringProperty email=new SimpleStringProperty();
    private StringProperty tablePrefix=new SimpleStringProperty();
    private StringProperty appPath=new SimpleStringProperty();
    private ObjectProperty<Date> createTime=new SimpleObjectProperty<>();
    private StringProperty appComment=new SimpleStringProperty();
    //private ObservableList<AppTableModel> appTableModels = FXCollections.observableArrayList();

    @Override
    public void clear() {
        id.setValue(null);
        schemaName.setValue(null);
        appName.setValue(null);
        appCnName.setValue(null);
        dbType.setValue(DatabaseType.MYSQL);
        dfPackageHead.setValue(null);
        modelName.setValue(null);
        author.setValue(null);
        email.setValue(null);
        tablePrefix.setValue(null);
        appPath.setValue(null);
        appComment.setValue(null);
        //appTableModels.clear();
    }

    public long getId() {
        return id.get();
    }

    public LongProperty idProperty() {
        return id;
    }

    public void setId(long id) {
        this.id.set(id);
    }

    public String getSchemaName() {
        return schemaName.get();
    }

    public StringProperty schemaNameProperty() {
        return schemaName;
    }

    public void setSchemaName(String schemaName) {
        this.schemaName.set(schemaName);
    }

    public String getAppName() {
        return appName.get();
    }

    public StringProperty appNameProperty() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName.set(appName);
    }

    public String getAppCnName() {
        return appCnName.get();
    }

    public StringProperty appCnNameProperty() {
        return appCnName;
    }

    public void setAppCnName(String appCnName) {
        this.appCnName.set(appCnName);
    }

    public DatabaseType getDbType() {
        return dbType.get();
    }

    public ObjectProperty<DatabaseType> dbTypeProperty() {
        return dbType;
    }

    public void setDbType(DatabaseType dbType) {
        this.dbType.set(dbType);
    }

    public String getDfPackageHead() {
        return dfPackageHead.get();
    }

    public StringProperty dfPackageHeadProperty() {
        return dfPackageHead;
    }

    public void setDfPackageHead(String dfPackageHead) {
        this.dfPackageHead.set(dfPackageHead);
    }

    public String getModelName() {
        return modelName.get();
    }

    public StringProperty modelNameProperty() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName.set(modelName);
    }

    public String getAuthor() {
        return author.get();
    }

    public StringProperty authorProperty() {
        return author;
    }

    public void setAuthor(String author) {
        this.author.set(author);
    }

    public String getEmail() {
        return email.get();
    }

    public StringProperty emailProperty() {
        return email;
    }

    public void setEmail(String email) {
        this.email.set(email);
    }

    public String getTablePrefix() {
        return tablePrefix.get();
    }

    public StringProperty tablePrefixProperty() {
        return tablePrefix;
    }

    public void setTablePrefix(String tablePrefix) {
        this.tablePrefix.set(tablePrefix);
    }

    public String getAppPath() {
        return appPath.get();
    }

    public StringProperty appPathProperty() {
        return appPath;
    }

    public void setAppPath(String appPath) {
        this.appPath.set(appPath);
    }

    public Date getCreateTime() {
        return createTime.get();
    }

    public ObjectProperty<Date> createTimeProperty() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime.set(createTime);
    }

    public String getAppComment() {
        return appComment.get();
    }

    public StringProperty appCommentProperty() {
        return appComment;
    }

    public void setAppComment(String appComment) {
        this.appComment.set(appComment);
    }

}
